home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / nfsmount / RCS / mount.x,v < prev    next >
Text File  |  1988-11-02  |  5KB  |  187 lines

  1. head     1.1;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @@;
  7.  
  8.  
  9. 1.1
  10. date     88.11.02.12.45.48;  author brent;  state Exp;
  11. branches ;
  12. next     ;
  13.  
  14.  
  15. desc
  16. @XDR definitions of the NFS mount protocol.  This file is
  17. the source for generating mount.h, mount_clnt.c, and mount_xdr.c
  18. @
  19.  
  20.  
  21.  
  22. 1.1
  23. log
  24. @Initial revision
  25. @
  26. text
  27. @/* @@(#)mount.x 1.4 88/02/08 Copyr 1987 Sun Micro */
  28. /*
  29.  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
  30.  * unrestricted use provided that this legend is included on all tape
  31.  * media and as a part of the software program in whole or part.  Users
  32.  * may copy or modify Sun RPC without charge, but are not authorized
  33.  * to license or distribute it to anyone else except as part of a product or
  34.  * program developed by the user.
  35.  * 
  36.  * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
  37.  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
  38.  * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
  39.  * 
  40.  * Sun RPC is provided with no support and without any obligation on the
  41.  * part of Sun Microsystems, Inc. to assist in its use, correction,
  42.  * modification or enhancement.
  43.  * 
  44.  * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
  45.  * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
  46.  * OR ANY PART THEREOF.
  47.  * 
  48.  * In no event will Sun Microsystems, Inc. be liable for any lost revenue
  49.  * or profits or other special, indirect and consequential damages, even if
  50.  * Sun has been advised of the possibility of such damages.
  51.  * 
  52.  * Sun Microsystems, Inc.
  53.  * 2550 Garcia Avenue
  54.  * Mountain View, California  94043
  55.  */
  56.  
  57. /*
  58.  * Protocol description for the mount program
  59.  */
  60.  
  61.  
  62. const MNTPATHLEN = 1024;    /* maximum bytes in a pathname argument */
  63. const MNTNAMLEN = 255;        /* maximum bytes in a name argument */
  64. const FHSIZE = 32;        /* size in bytes of a file handle */
  65.  
  66. /*
  67.  * The fhandle is the file handle that the server passes to the client.
  68.  * All file operations are done using the file handles to refer to a file
  69.  * or a directory. The file handle can contain whatever information the
  70.  * server needs to distinguish an individual file.
  71.  */
  72. typedef opaque fhandle[FHSIZE];    
  73.  
  74. /*
  75.  * If a status of zero is returned, the call completed successfully, and 
  76.  * a file handle for the directory follows. A non-zero status indicates
  77.  * some sort of error. The status corresponds with UNIX error numbers.
  78.  */
  79. union fhstatus switch (unsigned fhs_status) {
  80. case 0:
  81.     fhandle fhs_fhandle;
  82. default:
  83.     void;
  84. };
  85.  
  86. /*
  87.  * The type dirpath is the pathname of a directory
  88.  */
  89. typedef string dirpath<MNTPATHLEN>;
  90.  
  91. /*
  92.  * The type name is used for arbitrary names (hostnames, groupnames)
  93.  * (Changed to "arbname" because "name" is too good to waste.
  94.  */
  95. typedef string arbname<MNTNAMLEN>;
  96.  
  97. /*
  98.  * A list of who has what mounted
  99.  */
  100. struct mountlist {
  101.     arbname ml_hostname;
  102.     dirpath ml_directory;
  103.     mountlist *ml_next;
  104. };
  105.  
  106. /*
  107.  * A list of netgroups
  108.  */
  109. typedef struct groupnode *groups;
  110. struct groupnode {
  111.     arbname gr_name;
  112.     groups gr_next;
  113. };
  114.  
  115. /*
  116.  * A list of what is exported and to whom
  117.  */
  118. typedef struct exportnode *exports;
  119. struct exportnode {
  120.     dirpath ex_dir;
  121.     groups ex_groups;
  122.     exports ex_next;
  123. };
  124.  
  125. program MOUNTPROG {
  126.     /*
  127.      * Version one of the mount protocol communicates with version two
  128.      * of the NFS protocol. The only connecting point is the fhandle 
  129.      * structure, which is the same for both protocols.
  130.      */
  131.     version MOUNTVERS {
  132.         /*
  133.          * Does no work. It is made available in all RPC services
  134.          * to allow server reponse testing and timing
  135.          */
  136.         void
  137.         MOUNTPROC_NULL(void) = 0;
  138.  
  139.         /*    
  140.          * If fhs_status is 0, then fhs_fhandle contains the
  141.           * file handle for the directory. This file handle may
  142.          * be used in the NFS protocol. This procedure also adds
  143.          * a new entry to the mount list for this client mounting
  144.          * the directory.
  145.          * Unix authentication required.
  146.          */
  147.         fhstatus 
  148.         MOUNTPROC_MNT(dirpath) = 1;
  149.  
  150.         /*
  151.          * Returns the list of remotely mounted filesystems. The 
  152.          * mountlist contains one entry for each hostname and 
  153.          * directory pair.
  154.          */
  155.         mountlist
  156.         MOUNTPROC_DUMP(void) = 2;
  157.  
  158.         /*
  159.          * Removes the mount list entry for the directory
  160.          * Unix authentication required.
  161.          */
  162.         void
  163.         MOUNTPROC_UMNT(dirpath) = 3;
  164.  
  165.         /*
  166.          * Removes all of the mount list entries for this client
  167.          * Unix authentication required.
  168.          */
  169.         void
  170.         MOUNTPROC_UMNTALL(void) = 4;
  171.  
  172.         /*
  173.          * Returns a list of all the exported filesystems, and which
  174.          * machines are allowed to import it.
  175.          */
  176.         exports
  177.         MOUNTPROC_EXPORT(void)  = 5;
  178.     
  179.         /*
  180.          * Identical to MOUNTPROC_EXPORT above
  181.          */
  182.         exports
  183.         MOUNTPROC_EXPORTALL(void) = 6;
  184.     } = 1;
  185. } = 100005;
  186. @
  187.